package com.treasure.hunt.mode

import android.app.Application
import androidx.lifecycle.MutableLiveData
import com.blankj.utilcode.util.LogUtils
import com.module.lemlin.base.BaseViewModel
import com.module.lemlin.mode.ViewModelSubscribe
import com.module.lemlin.rxhttp.HttpServiceData
import com.module.lemlin.rxhttp.HttpServiceResponse
import com.treasure.hunt.api.*
import com.treasure.hunt.entity.*
import io.reactivex.rxjava3.disposables.Disposable

class UserViewMode(application: Application) : BaseViewModel(application) {

    val userInfoLiveData = MutableLiveData<HttpServiceResponse<UserInfoResponse>>()

    val baseLiveData = MutableLiveData<HttpServiceResponse<HttpServiceData>>()

    fun userInfo() {
        val disposable: Disposable =
            userInfo(ViewModelSubscribe(userInfoLiveData))
        dispose.add(disposable)
    }


    fun userThird(code: String) {
        val disposable: Disposable =
            userThird(code, ViewModelSubscribe(baseLiveData))
        dispose.add(disposable)
    }


    fun userProfile(nickname: String) {
        val disposable: Disposable =
            userProfile(nickname, ViewModelSubscribe(baseLiveData))
        dispose.add(disposable)
    }
}